<template>
  <div class="method-box">
    <h6>低价优先法:</h6>
    <div>
      <el-form ref="formRef" :model="form" label-width="auto" :rules="rules">
        <div class="flex gap-1">
          评分点计算公式：投标报价得分=（评标基准价/投标评审价格）*价格权值*100（本次招标价格权值为
          <el-form-item prop="scoreP">
            <el-input
              v-model.number="form.scoreP"
              :disabled="disabled"
              class="text-input"
              size="small"
              clearable
              type="number"
              placeholder="P"
              @change="reflectChange"
            />
          </el-form-item>
          % ）
        </div>
        <div>评标基准价=所有有效投标中最低报价</div>
      </el-form>
    </div>
  </div>
</template>
<script setup lang="ts">
const emit = defineEmits(['value-change'])
const reflectChange = () => {
  emit('value-change')
}
const rules = ref<any>({
  scoreP: [{ required: true, message: '请输入scoreP' }]
})
const form = ref<any>({
  scoreP: ''
})
const props = defineProps({
  formData: {
    type: Object,
    required: true
  },
  disabled: {
    type: Boolean,
    default: false
  }
})
const init = () => {
  form.value = props.formData
}
onMounted(() => {
  init()
})
const formRef = ref()
const submitForm = async () => {
  const res = await formRef.value.validate()
  return res
}
defineExpose({ form, submitForm })
</script>
<style scoped lang="scss" src="./text-common.scss"></style>
